	
function changeshoppingcart(coid,buynumber,cid,name,price) {

    var shoppingcart = getshoppingcart()
    var key = -1;
    for(var i in shoppingcart) {

        if(shoppingcart[i].coid == coid) {
            key = i;
        }
    }

    if(key == -1) {

        var coinfo = {
            cid:cid,
            price:price,
            coid: coid,
            name:name,
            buynumber: 1
        }
        shoppingcart.push(coinfo)
    } else {
        if(buynumber == null) {
            buynumber = 1;
        }
        var newnumber=shoppingcart[key].buynumber + buynumber;
        if(newnumber>0 )
        {
            shoppingcart[key].buynumber = newnumber
        }
        else {
            shoppingcart=dellist(key,shoppingcart)
        }
    }
    cookie("shoppingcart_"+sid, JSON.stringify(shoppingcart),1);
    try{
        shoppingcart_display();
    }catch(e)
    {
    }

}

function getshoppingcart() {
    var shoppingcart = [];
    try {
        shoppingcart = JSON.parse(cookie("shoppingcart_"+sid));
    } catch(e) {

    }
    return shoppingcart
}


function clearnshopcart(){
    cookie("shoppingcart_"+sid,"del");
}